From 70b4f633a6fbedb58c8b9134ac64ede854d489de Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 12:27:46 +0100 Subject: refactor(components): replace PageLayout template with Page * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome` --- src/pages/blog/page/[number].tsx | 105 ++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 62 deletions(-) (limited to 'src/pages/blog/page/[number].tsx') diff --git a/src/pages/blog/page/[number].tsx b/src/pages/blog/page/[number].tsx index 27d1816..b254603 100644 --- a/src/pages/blog/page/[number].tsx +++ b/src/pages/blog/page/[number].tsx @@ -10,13 +10,14 @@ import { getLayout, Heading, LinksWidget, - PageLayout, PostsList, Pagination, type RenderPaginationLink, type RenderPaginationItemAriaLabel, - MetaList, - MetaItem, + Page, + PageHeader, + PageBody, + PageSidebar, } from '../../../components'; import { getArticles, @@ -195,7 +196,7 @@ const BlogPage: NextPageWithLayout = ({ }); return ( - <> + {page.title} {/*eslint-disable-next-line react/jsx-no-literals -- Name allowed */} @@ -213,60 +214,17 @@ const BlogPage: NextPageWithLayout = ({ // eslint-disable-next-line react/no-danger -- Necessary for schema dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }} /> - - - - } - widgets={[ - - {thematicsListTitle} - - } - items={getLinksItemData( - thematicsList.map((thematic) => - getPageLinkFromRawData(thematic, 'thematic') - ) - )} - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="thematics-list" - />, - - {topicsListTitle} - - } - items={getLinksItemData( - topicsList.map((topic) => getPageLinkFromRawData(topic, 'topic')) - )} - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="topics-list" - />, - ]} - > +